package day02;
//char类型的演示
public class CharDemo {
    public static void main(String[] args) {
        //5)char:字符型, 2个字节
        char c1 = '女';  //字符女
        char c2 = 'f';  //字符f
        char c3 = '6';  //字符6
        char c4 = ' ';  //空格符
        //char c5 = 女;  //编译错误, 字符型直接量必须放在单引号中
        //char c6 = ''; //编译错误, 必须有字符
        //char c7 = '10'; //编译错误, 只能存储1个字符

        char c8 = 65; //0到65535之间
        System.out.println(c8); //println()会依据变量的类型做输出展示
                                //c8为char型, 所以会以字符的形式输出--------A

        char c9 = '\\';
        System.out.println(c9); // \

        //---------------------------------------------------------------

        //第二遍
        /*
        char c1 = '女';
        char c2 = 'f';
        char c3 = '6';
        char c4 = ' ';

        char c8 = 65;
        System.out.println(c8);

        char c9 = '\\';
        System.out.println(c9);
        */
    }
}
